<!DOCTYPE html>
<html lang="zh-CnN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <button>this</button>
</body>
<script>
  // function fn(){
  //   console.log(this);
  // }
  // fn(); //this 指向window
  // window.fn();


  var car = {
    name: "小明",
    getname: function(){
      setTimeout(function() {
        console.log(this);
      }, 1000);
    }
  }

  car.getname();

  var btn = document.getElementsByTagName('button')[0];
  btn.addEventListener('click', function () {
    console.log(this);
  },false);


  
</script>
</html>